package chapter16;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.LockSupport;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/2/23 16:20
 */
public class LockSupportTest {
    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(() -> {
            LockSupport.park();
            System.out.println("exit");
        });

        thread.start();
        TimeUnit.SECONDS.sleep(2);
        LockSupport.unpark(thread);
    }
}
